package com.jysz.certificate.persistence.model.cs;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.jysz.certificate.persistence.enums.cs.TheNetWorkStatus;
import com.jysz.certificate.persistence.model.system.Brand;
import com.jysz.certificate.persistence.model.system.Financial;
import com.jysz.certificate.persistence.model.system.Shop;
import com.jysz.certificate.persistence.model.system.User;
import com.jysz.webcore.ssh.entity.AbstractBaseEntity;

@Entity
@Table(name = "cs_the_network_")
@org.hibernate.annotations.Entity
public class TheNetwork extends AbstractBaseEntity<Long> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	

	/** property column names begin**/
		public static final String COLUMN_APPLICATIONDATE="applicationDate";
		public static final String COLUMN_SHOP="shop";
		public static final String COLUMN_BRAND="brand";
		public static final String COLUMN_FINANCIAL="financial";
		/** property column names end**/
		
	private Shop shop;
	private Financial financial;
	private Brand brand;
	private User user;
	private String theNumber;//申请单号
	private Date applicationDate;//申请时间
	private List<TheNetworkList> theNetworks;
	private TheNetWorkStatus state;//状态
	private Integer amount;
	private Integer passAmount;
	@Column(name = "_amount")
	public Integer getAmount() {
		return amount;
	}
	public void setAmount(Integer amount) {
		this.amount = amount;
	}
	@Column(name = "_pass_amount",columnDefinition="int(11)")
	public Integer getPassAmount() {
		return passAmount;
	}
	public void setPassAmount(Integer passAmount) {
		this.passAmount = passAmount;
	}
	@Column(name = "_state",columnDefinition="int(11)")
	@Enumerated(EnumType.ORDINAL)
	public TheNetWorkStatus getState() {
		return state;
	}
	public void setState(TheNetWorkStatus state) {
		this.state = state;
	}
	@OneToMany(targetEntity = TheNetworkList.class, cascade = { CascadeType.ALL }, mappedBy = "theNetwork")  
	public List<TheNetworkList> getTheNetworks() {
		return theNetworks;
	}
	public void setTheNetworks(List<TheNetworkList> theNetworks) {
		this.theNetworks = theNetworks;
	}
	@ManyToOne(fetch = FetchType.LAZY)  
	@JoinColumn(name = "_shop_id",columnDefinition="bigint(20)") 
	public Shop getShop() {
		return shop;
	}
	
	public void setShop(Shop shop) {
		this.shop = shop;
	}
	@ManyToOne(fetch = FetchType.LAZY)  
	@JoinColumn(name = "_financial_id",columnDefinition="bigint(20)") 
	public Financial getFinancial() {
		return financial;
	}
	public void setFinancial(Financial financial) {
		this.financial = financial;
	}
	@ManyToOne(fetch = FetchType.LAZY)  
	@JoinColumn(name = "_brand_id",columnDefinition="bigint(20)") 
	public Brand getBrand() {
		return brand;
	}
	public void setBrand(Brand brand) {
		this.brand = brand;
	}
	@ManyToOne(fetch = FetchType.LAZY)  
	@JoinColumn(name = "_user_id",columnDefinition="bigint(20)") 
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@Column(name = "_theNumber",columnDefinition="varchar(255)")
	public String getTheNumber() {
		return theNumber;
	}
	public void setTheNumber(String theNumber) {
		this.theNumber = theNumber;
	}
	@Column(name = "_applicationDate")
	public Date getApplicationDate() {
		return applicationDate;
	}
	public void setApplicationDate(Date applicationDate) {
		this.applicationDate = applicationDate;
	}
	
	

}
